package com.uplooking.controller;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class SuccessController extends HttpServlet {
    @Override
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        resp.setHeader("Content-Type", "text/html;charset=utf8");
        String username=req.getParameter("username");
        String password= req.getParameter("password");
        String phone=req.getParameter("phone");
        String number=req.getParameter("number");
       System.out.println(username!=null);
       System.out.println(password!="");
       System.out.println(number!=null);
        if(username!=""  && password!=null &&number!="" &&phone!=""){

            req.getRequestDispatcher("/index.jsp").forward(req, resp);
        }else {

            req.getRequestDispatcher("/index01.jsp").forward(req, resp);
        }
    }
}
